<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qwt User&#39;s Guide: qwt_counter.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('qwt__counter_8cpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">qwt_counter.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Qwt Widget Library</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (C) 1997   Josef Wilgen</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (C) 2002   Uwe Rathmann</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * This library is free software; you can redistribute it and/or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;qwt_arrow_button.h&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;qwt_counter.h&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;qwt_painter.h&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;qwt_math.h&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;qlayout.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;qlineedit.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;qvalidator.h&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;qevent.h&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;qstyle.h&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">class </span>QwtCounter::PrivateData</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;{</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    PrivateData()</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        : <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>( 0.0 )</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        , <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>( 0.0 )</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        , <a class="code" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">singleStep</a>( 1.0 )</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        , <a class="code" href="class_qwt_counter.html#a613e5d3f2111f7263cf540156d9413e9">isValid</a>( false )</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;        , <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>( 0.0 )</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        , <a class="code" href="class_qwt_counter.html#a5cb416959b578a1615e000bc8c40e359">wrapping</a>( false )</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    {</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        increment[<a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179">Button1</a>] = 1;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        increment[<a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d">Button2</a>] = 10;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        increment[<a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74">Button3</a>] = 100;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    }</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>* buttonDown[<a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a>];</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>* buttonUp[<a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a>];</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    QLineEdit* valueEdit;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keywordtype">int</span> increment[<a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a>];</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_qwt_counter.html#ab7aa5fbf0041f6e1d99c1ceafbc8bb10">numButtons</a>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">singleStep</a>;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_qwt_counter.html#a613e5d3f2111f7263cf540156d9413e9">isValid</a>;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_qwt_counter.html#a5cb416959b578a1615e000bc8c40e359">wrapping</a>;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;};</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#aee94cdbaf1f3d22e110fd3535dbca34a">   65</a></span>&#160;<a class="code" href="class_qwt_counter.html#aee94cdbaf1f3d22e110fd3535dbca34a">QwtCounter::QwtCounter</a>( QWidget* parent )</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    : QWidget( parent )</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;{</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    initCounter();</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;}</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keywordtype">void</span> QwtCounter::initCounter()</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;{</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    m_data = <span class="keyword">new</span> PrivateData;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    QHBoxLayout* layout = <span class="keyword">new</span> QHBoxLayout( <span class="keyword">this</span> );</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    layout-&gt;setSpacing( 0 );</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    layout-&gt;setContentsMargins( QMargins() );</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a> - 1; i &gt;= 0; i-- )</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    {</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>* btn =</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            <span class="keyword">new</span> <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>( i + 1, Qt::DownArrow, <span class="keyword">this</span> );</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        btn-&gt;setFocusPolicy( Qt::NoFocus );</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        layout-&gt;addWidget( btn );</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        connect( btn, SIGNAL(released()), SLOT(btnReleased()) );</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        connect( btn, SIGNAL(clicked()), SLOT(btnClicked()) );</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        m_data-&gt;buttonDown[i] = btn;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    }</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    m_data-&gt;valueEdit = <span class="keyword">new</span> QLineEdit( <span class="keyword">this</span> );</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    m_data-&gt;valueEdit-&gt;setReadOnly( <span class="keyword">false</span> );</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    m_data-&gt;valueEdit-&gt;setValidator( <span class="keyword">new</span> QDoubleValidator( m_data-&gt;valueEdit ) );</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    layout-&gt;addWidget( m_data-&gt;valueEdit );</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    connect( m_data-&gt;valueEdit, SIGNAL(editingFinished()), SLOT(textChanged()) );</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    layout-&gt;setStretchFactor( m_data-&gt;valueEdit, 10 );</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a>; i++ )</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>* btn =</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;            <span class="keyword">new</span> <a class="code" href="class_qwt_arrow_button.html">QwtArrowButton</a>( i + 1, Qt::UpArrow, <span class="keyword">this</span> );</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        btn-&gt;setFocusPolicy( Qt::NoFocus );</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        layout-&gt;addWidget( btn );</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        connect( btn, SIGNAL(released()), SLOT(btnReleased()) );</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        connect( btn, SIGNAL(clicked()), SLOT(btnClicked()) );</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        m_data-&gt;buttonUp[i] = btn;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    }</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <a class="code" href="class_qwt_counter.html#a900729c8f73830b549ea065e5c6dc4f9">setNumButtons</a>( 2 );</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <a class="code" href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">setRange</a>( 0.0, 1.0 );</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <a class="code" href="class_qwt_counter.html#aeeb79c9b83b2050baf9d7e6e47f1fa67">setSingleStep</a>( 0.001 );</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <a class="code" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">setValue</a>( 0.0 );</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    setSizePolicy(</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    setFocusProxy( m_data-&gt;valueEdit );</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    setFocusPolicy( Qt::StrongFocus );</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;}</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a6469133eb210b470023a3dcc735aec4d">  127</a></span>&#160;<a class="code" href="class_qwt_counter.html#a6469133eb210b470023a3dcc735aec4d">QwtCounter::~QwtCounter</a>()</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;{</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="keyword">delete</span> m_data;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;}</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#aa06625ab417f82fdc82790e3376af708">  142</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#aa06625ab417f82fdc82790e3376af708">QwtCounter::setValid</a>( <span class="keywordtype">bool</span> on )</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;{</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordflow">if</span> ( on != m_data-&gt;isValid )</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    {</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        m_data-&gt;isValid = on;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        updateButtons();</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        <span class="keywordflow">if</span> ( m_data-&gt;isValid )</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;            showNumber( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>() );</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;            Q_EMIT <a class="code" href="class_qwt_counter.html#add02928c348417fbfadd7095d058f331">valueChanged</a>( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>() );</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        }</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        {</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;            m_data-&gt;valueEdit-&gt;setText( QString() );</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        }</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    }</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;}</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a613e5d3f2111f7263cf540156d9413e9">  166</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_qwt_counter.html#a613e5d3f2111f7263cf540156d9413e9">QwtCounter::isValid</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;isValid;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;}</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160; </div>
<div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#ad34441cf06c68478b826e5b85fbb3ba7">  177</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#ad34441cf06c68478b826e5b85fbb3ba7">QwtCounter::setReadOnly</a>( <span class="keywordtype">bool</span> on )</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;{</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    m_data-&gt;valueEdit-&gt;setReadOnly( on );</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;}</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a59c836008c9c9e2c9c3048cbd5c80778">  186</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_qwt_counter.html#a59c836008c9c9e2c9c3048cbd5c80778">QwtCounter::isReadOnly</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;valueEdit-&gt;isReadOnly();</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;}</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">  202</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">QwtCounter::setValue</a>( <span class="keywordtype">double</span> value )</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;{</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> vmin = qwtMinF( m_data-&gt;minimum, m_data-&gt;maximum );</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> vmax = qwtMaxF( m_data-&gt;minimum, m_data-&gt;maximum );</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = qBound( vmin, <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>, vmax );</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <span class="keywordflow">if</span> ( !m_data-&gt;isValid || <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> != m_data-&gt;value )</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    {</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        m_data-&gt;isValid = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        m_data-&gt;value = <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>;</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160; </div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;        showNumber( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> );</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;        updateButtons();</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        Q_EMIT <a class="code" href="class_qwt_counter.html#add02928c348417fbfadd7095d058f331">valueChanged</a>( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> );</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    }</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;}</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">  225</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">QwtCounter::value</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;value;</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;}</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">  241</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">QwtCounter::setRange</a>( <span class="keywordtype">double</span> min, <span class="keywordtype">double</span> max )</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;{</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    max = qwtMaxF( min, max );</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160; </div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;maximum == max &amp;&amp; m_data-&gt;minimum == min )</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160; </div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    m_data-&gt;minimum = min;</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    m_data-&gt;maximum = max;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160; </div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <a class="code" href="class_qwt_counter.html#aeeb79c9b83b2050baf9d7e6e47f1fa67">setSingleStep</a>( <a class="code" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">singleStep</a>() );</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160; </div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = qBound( min, m_data-&gt;value, max );</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> != m_data-&gt;value )</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    {</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        m_data-&gt;value = <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160; </div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;        <span class="keywordflow">if</span> ( m_data-&gt;isValid )</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;        {</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            showNumber( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> );</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;            Q_EMIT <a class="code" href="class_qwt_counter.html#add02928c348417fbfadd7095d058f331">valueChanged</a>( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> );</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    }</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160; </div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    updateButtons();</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;}</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160; </div>
<div class="line"><a name="l00277"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a4f5847dca54ada119623908730568f4d">  277</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#a4f5847dca54ada119623908730568f4d">QwtCounter::setMinimum</a>( <span class="keywordtype">double</span> value )</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;{</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <a class="code" href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">setRange</a>( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>, <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>() );</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;}</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">  286</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">QwtCounter::minimum</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;minimum;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;}</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160; </div>
<div class="line"><a name="l00297"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#af097141eaa83c32c7eb7d4234079f95a">  297</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#af097141eaa83c32c7eb7d4234079f95a">QwtCounter::setMaximum</a>( <span class="keywordtype">double</span> value )</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;{</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <a class="code" href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">setRange</a>( <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>(), <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> );</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;}</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160; </div>
<div class="line"><a name="l00306"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">  306</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">QwtCounter::maximum</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;maximum;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;}</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160; </div>
<div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#aeeb79c9b83b2050baf9d7e6e47f1fa67">  319</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#aeeb79c9b83b2050baf9d7e6e47f1fa67">QwtCounter::setSingleStep</a>( <span class="keywordtype">double</span> stepSize )</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;{</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    m_data-&gt;singleStep = qwtMaxF( stepSize, 0.0 );</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;}</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160; </div>
<div class="line"><a name="l00328"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">  328</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">QwtCounter::singleStep</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;singleStep;</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;}</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160; </div>
<div class="line"><a name="l00342"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a8fc7d115682f295dfcc64fa8312ccdeb">  342</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#a8fc7d115682f295dfcc64fa8312ccdeb">QwtCounter::setWrapping</a>( <span class="keywordtype">bool</span> on )</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;{</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;    m_data-&gt;wrapping = on;</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;}</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160; </div>
<div class="line"><a name="l00351"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a5cb416959b578a1615e000bc8c40e359">  351</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_qwt_counter.html#a5cb416959b578a1615e000bc8c40e359">QwtCounter::wrapping</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;wrapping;</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;}</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160; </div>
<div class="line"><a name="l00362"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a900729c8f73830b549ea065e5c6dc4f9">  362</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#a900729c8f73830b549ea065e5c6dc4f9">QwtCounter::setNumButtons</a>( <span class="keywordtype">int</span> numButtons )</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;{</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keywordflow">if</span> ( numButtons &lt; 0 || numButtons &gt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a> )</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160; </div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a>; i++ )</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    {</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;        <span class="keywordflow">if</span> ( i &lt; <a class="code" href="class_qwt_counter.html#ab7aa5fbf0041f6e1d99c1ceafbc8bb10">numButtons</a> )</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;        {</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;            m_data-&gt;buttonDown[i]-&gt;show();</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;            m_data-&gt;buttonUp[i]-&gt;show();</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;        }</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;        <span class="keywordflow">else</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;        {</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;            m_data-&gt;buttonDown[i]-&gt;hide();</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;            m_data-&gt;buttonUp[i]-&gt;hide();</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;        }</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;    }</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160; </div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    m_data-&gt;numButtons = <a class="code" href="class_qwt_counter.html#ab7aa5fbf0041f6e1d99c1ceafbc8bb10">numButtons</a>;</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;}</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160; </div>
<div class="line"><a name="l00388"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#ab7aa5fbf0041f6e1d99c1ceafbc8bb10">  388</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_qwt_counter.html#ab7aa5fbf0041f6e1d99c1ceafbc8bb10">QwtCounter::numButtons</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;    <span class="keywordflow">return</span> m_data-&gt;numButtons;</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;}</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160; </div>
<div class="line"><a name="l00403"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#ac308bb656eaa001641bdef6524d40ce6">  403</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#ac308bb656eaa001641bdef6524d40ce6">QwtCounter::setIncSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374">QwtCounter::Button</a> button, <span class="keywordtype">int</span> numSteps )</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;{</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;    <span class="keywordflow">if</span> ( button &gt;= 0 &amp;&amp; button &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a> )</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        m_data-&gt;increment[ button ] = numSteps;</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;}</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160; </div>
<div class="line"><a name="l00416"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a91149ef07b94558456479357d6f98151">  416</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_qwt_counter.html#a91149ef07b94558456479357d6f98151">QwtCounter::incSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374">QwtCounter::Button</a> button )<span class="keyword"> const</span></div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    <span class="keywordflow">if</span> ( button &gt;= 0 &amp;&amp; button &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a> )</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;        <span class="keywordflow">return</span> m_data-&gt;increment[ button ];</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160; </div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;}</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160; </div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160; </div>
<div class="line"><a name="l00429"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#ae56a556a72955b6d10419f2c41779383">  429</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#ae56a556a72955b6d10419f2c41779383">QwtCounter::setStepButton1</a>( <span class="keywordtype">int</span> nSteps )</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;{</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;    <a class="code" href="class_qwt_counter.html#ac308bb656eaa001641bdef6524d40ce6">setIncSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179">QwtCounter::Button1</a>, nSteps );</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;}</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160; </div>
<div class="line"><a name="l00435"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#affdd91a6698ff0c90e24e69ff410924f">  435</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_qwt_counter.html#affdd91a6698ff0c90e24e69ff410924f">QwtCounter::stepButton1</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_qwt_counter.html#a91149ef07b94558456479357d6f98151">incSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179">QwtCounter::Button1</a> );</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;}</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160; </div>
<div class="line"><a name="l00444"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a0d764a96706593d8c8b51338e92abfcc">  444</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#a0d764a96706593d8c8b51338e92abfcc">QwtCounter::setStepButton2</a>( <span class="keywordtype">int</span> nSteps )</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;{</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    <a class="code" href="class_qwt_counter.html#ac308bb656eaa001641bdef6524d40ce6">setIncSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d">QwtCounter::Button2</a>, nSteps );</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;}</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160; </div>
<div class="line"><a name="l00450"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#acec167b50ae44afe5ff8e9233e77a939">  450</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_qwt_counter.html#acec167b50ae44afe5ff8e9233e77a939">QwtCounter::stepButton2</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_qwt_counter.html#a91149ef07b94558456479357d6f98151">incSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d">QwtCounter::Button2</a> );</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;}</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160; </div>
<div class="line"><a name="l00459"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a8b55539578de083793b8310cb8909294">  459</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#a8b55539578de083793b8310cb8909294">QwtCounter::setStepButton3</a>( <span class="keywordtype">int</span> nSteps )</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;{</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;    <a class="code" href="class_qwt_counter.html#ac308bb656eaa001641bdef6524d40ce6">setIncSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74">QwtCounter::Button3</a>, nSteps );</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;}</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160; </div>
<div class="line"><a name="l00465"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a259de8df2b8928139d1fc4738694eac8">  465</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_qwt_counter.html#a259de8df2b8928139d1fc4738694eac8">QwtCounter::stepButton3</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_qwt_counter.html#a91149ef07b94558456479357d6f98151">incSteps</a>( <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74">QwtCounter::Button3</a> );</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;}</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160; </div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;<span class="keywordtype">void</span> QwtCounter::textChanged()</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;{</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;    <span class="keywordtype">bool</span> converted = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160; </div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = m_data-&gt;valueEdit-&gt;text().toDouble( &amp;converted );</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    <span class="keywordflow">if</span> ( converted )</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;        <a class="code" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">setValue</a>( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> );</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;}</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160; </div>
<div class="line"><a name="l00485"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">  485</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">QwtCounter::event</a>( QEvent* event )</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;{</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;    <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;type() == QEvent::PolishRequest )</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;    {</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;        <span class="keyword">const</span> QFontMetrics fm = m_data-&gt;valueEdit-&gt;fontMetrics();</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160; </div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">int</span> w = <a class="code" href="class_qwt_painter.html#af66a967fc49ff6deae32c3fd3826045b">QwtPainter::horizontalAdvance</a>( fm, <span class="stringliteral">&quot;W&quot;</span> ) + 8;</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;        <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a>; i++ )</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;        {</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;            m_data-&gt;buttonDown[i]-&gt;setMinimumWidth( w );</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;            m_data-&gt;buttonUp[i]-&gt;setMinimumWidth( w );</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;        }</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;    }</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160; </div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    <span class="keywordflow">return</span> QWidget::event( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a> );</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;}</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160; </div>
<div class="line"><a name="l00524"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#abc926a33f67199790a2e759fed84bfe5">  524</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#abc926a33f67199790a2e759fed84bfe5">QwtCounter::keyPressEvent</a> ( QKeyEvent* event )</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;{</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;    <span class="keywordtype">bool</span> accepted = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160; </div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;    <span class="keywordflow">switch</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;key() )</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;    {</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;        <span class="keywordflow">case</span> Qt::Key_Home:</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;        {</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;            <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;modifiers() &amp; Qt::ControlModifier )</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;                <a class="code" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">setValue</a>( <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>() );</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;                accepted = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;        }</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;        <span class="keywordflow">case</span> Qt::Key_End:</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;        {</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;            <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;modifiers() &amp; Qt::ControlModifier )</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;                <a class="code" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">setValue</a>( <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>() );</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;                accepted = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;        }</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;        <span class="keywordflow">case</span> Qt::Key_Up:</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;        {</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;            incrementValue( m_data-&gt;increment[0] );</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;        }</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;        <span class="keywordflow">case</span> Qt::Key_Down:</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;        {</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;            incrementValue( -m_data-&gt;increment[0] );</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;        }</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;        <span class="keywordflow">case</span> Qt::Key_PageUp:</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;        <span class="keywordflow">case</span> Qt::Key_PageDown:</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;        {</div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;            <span class="keywordtype">int</span> increment = m_data-&gt;increment[0];</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;            <span class="keywordflow">if</span> ( m_data-&gt;numButtons &gt;= 2 )</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;                increment = m_data-&gt;increment[1];</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;            <span class="keywordflow">if</span> ( m_data-&gt;numButtons &gt;= 3 )</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;            {</div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;                <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;modifiers() &amp; Qt::ShiftModifier )</div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;                    increment = m_data-&gt;increment[2];</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;            }</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;            <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;key() == Qt::Key_PageDown )</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;                increment = -increment;</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;            incrementValue( increment );</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;        }</div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;        {</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;            accepted = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        }</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;    }</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160; </div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    <span class="keywordflow">if</span> ( accepted )</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;    {</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;        <span class="keyword">event</span>-&gt;accept();</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;    }</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160; </div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;    QWidget::keyPressEvent ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a> );</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;}</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160; </div>
<div class="line"><a name="l00591"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#afe42754ad6e79fbbca1a69c23e7fc380">  591</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_qwt_counter.html#afe42754ad6e79fbbca1a69c23e7fc380">QwtCounter::wheelEvent</a>( QWheelEvent* event )</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;{</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;    <span class="keyword">event</span>-&gt;accept();</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160; </div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;numButtons &lt;= 0 )</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160; </div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;    <span class="keywordtype">int</span> increment = m_data-&gt;increment[0];</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;numButtons &gt;= 2 )</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    {</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;        <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;modifiers() &amp; Qt::ControlModifier )</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;            increment = m_data-&gt;increment[1];</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;    }</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;numButtons &gt;= 3 )</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;    {</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;        <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">event</a>-&gt;modifiers() &amp; Qt::ShiftModifier )</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;            increment = m_data-&gt;increment[2];</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;    }</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160; </div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;<span class="preprocessor">#if QT_VERSION &lt; 0x050e00</span></div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;    <span class="keyword">const</span> QPoint wheelPos = <span class="keyword">event</span>-&gt;pos();</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> wheelDelta = <span class="keyword">event</span>-&gt;delta();</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;    <span class="keyword">const</span> QPoint wheelPos = <span class="keyword">event</span>-&gt;position().toPoint();</div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160; </div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;    <span class="keyword">const</span> QPoint delta = <span class="keyword">event</span>-&gt;angleDelta();</div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> wheelDelta = ( qAbs( delta.x() ) &gt; qAbs( delta.y() ) )</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;        ? delta.x() : delta.y();</div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160; </div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;    <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; m_data-&gt;numButtons; i++ )</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;    {</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;        <span class="keywordflow">if</span> ( m_data-&gt;buttonDown[i]-&gt;geometry().contains( wheelPos ) ||</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;            m_data-&gt;buttonUp[i]-&gt;geometry().contains( wheelPos ) )</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;        {</div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;            increment = m_data-&gt;increment[i];</div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;        }</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;    }</div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160; </div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;    incrementValue( wheelDelta / 120 * increment );</div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;}</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160; </div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;<span class="keywordtype">void</span> QwtCounter::incrementValue( <span class="keywordtype">int</span> numSteps )</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;{</div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> min = m_data-&gt;minimum;</div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">double</span> max = m_data-&gt;maximum;</div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;    <span class="keywordtype">double</span> stepSize = m_data-&gt;singleStep;</div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160; </div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;    <span class="keywordflow">if</span> ( !m_data-&gt;isValid || min &gt;= max || stepSize &lt;= 0.0 )</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160; </div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160; </div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;<span class="preprocessor">#if 1</span></div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;    stepSize = qwtMaxF( stepSize, 1.0e-10 * ( max - min ) );</div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160; </div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;    <span class="keywordtype">double</span> <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = m_data-&gt;value + numSteps * stepSize;</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160; </div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;wrapping )</div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;    {</div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">double</span> range = max - min;</div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160; </div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;        <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> &lt; min )</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;        {</div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;            <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> += std::ceil( ( min - <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> ) / range ) * range;</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;        }</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> &gt; max )</div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;        {</div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;            <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> -= std::ceil( ( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> - max ) / range ) * range;</div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;        }</div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;    }</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;    {</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;        <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = qBound( min, <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>, max );</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;    }</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160; </div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;    <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = min + qRound( ( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> - min ) / stepSize ) * stepSize;</div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160; </div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;    <span class="keywordflow">if</span> ( stepSize &gt; 1e-12 )</div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;    {</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;        <span class="keywordflow">if</span> ( qFuzzyCompare( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> + 1.0, 1.0 ) )</div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;        {</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;            <span class="comment">// correct rounding error if value = 0</span></div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;            <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = 0.0;</div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;        }</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( qFuzzyCompare( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>, max ) )</div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;        {</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;            <span class="comment">// correct rounding error at the border</span></div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;            <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> = max;</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;        }</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;    }</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160; </div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;    <span class="keywordflow">if</span> ( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a> != m_data-&gt;value )</div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;    {</div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;        m_data-&gt;value = <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>;</div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;        showNumber( m_data-&gt;value );</div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;        updateButtons();</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160; </div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;        Q_EMIT <a class="code" href="class_qwt_counter.html#add02928c348417fbfadd7095d058f331">valueChanged</a>( m_data-&gt;value );</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;    }</div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;}</div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160; </div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160; </div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;<span class="keywordtype">void</span> QwtCounter::updateButtons()</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;{</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;isValid )</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    {</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;        <span class="comment">// 1. save enabled state of the smallest down- and up-button</span></div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;        <span class="comment">// 2. change enabled state on under- or over-flow</span></div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160; </div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;        <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a>; i++ )</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;        {</div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;            m_data-&gt;buttonDown[i]-&gt;setEnabled( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>() &gt; <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>() );</div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;            m_data-&gt;buttonUp[i]-&gt;setEnabled( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>() &lt; <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>() );</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;        }</div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;    }</div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;    {</div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;        <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a>; i++ )</div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;        {</div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;            m_data-&gt;buttonDown[i]-&gt;setEnabled( <span class="keyword">false</span> );</div>
<div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;            m_data-&gt;buttonUp[i]-&gt;setEnabled( <span class="keyword">false</span> );</div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;        }</div>
<div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;    }</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;}</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;<span class="keywordtype">void</span> QwtCounter::showNumber( <span class="keywordtype">double</span> number )</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;{</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;    QString text;</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;    text.setNum( number );</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160; </div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> cursorPos = m_data-&gt;valueEdit-&gt;cursorPosition();</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;    m_data-&gt;valueEdit-&gt;setText( text );</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;    m_data-&gt;valueEdit-&gt;setCursorPosition( cursorPos );</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;}</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160; </div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;<span class="keywordtype">void</span> QwtCounter::btnClicked()</div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;{</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    <span class="keywordflow">for</span> ( <span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">ButtonCnt</a>; i++ )</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;    {</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;        <span class="keywordflow">if</span> ( m_data-&gt;buttonUp[i] == sender() )</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;            incrementValue( m_data-&gt;increment[i] );</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160; </div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;        <span class="keywordflow">if</span> ( m_data-&gt;buttonDown[i] == sender() )</div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;            incrementValue( -m_data-&gt;increment[i] );</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;    }</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;}</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160; </div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;<span class="keywordtype">void</span> QwtCounter::btnReleased()</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;{</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;    Q_EMIT <a class="code" href="class_qwt_counter.html#a694ed7277e137e44bccc5918b4c15ecc">buttonReleased</a>( <a class="code" href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">value</a>() );</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;}</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160; </div>
<div class="line"><a name="l00759"></a><span class="lineno"><a class="line" href="class_qwt_counter.html#a55908902767443a3079b6635da98ddb5">  759</a></span>&#160;QSize <a class="code" href="class_qwt_counter.html#a55908902767443a3079b6635da98ddb5">QwtCounter::sizeHint</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;    QString tmp;</div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160; </div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;    <span class="keywordtype">int</span> w = tmp.setNum( <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>() ).length();</div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;    <span class="keywordtype">int</span> w1 = tmp.setNum( <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>() ).length();</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;    <span class="keywordflow">if</span> ( w1 &gt; w )</div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;        w = w1;</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;    w1 = tmp.setNum( <a class="code" href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">minimum</a>() + <a class="code" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">singleStep</a>() ).length();</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;    <span class="keywordflow">if</span> ( w1 &gt; w )</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;        w = w1;</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;    w1 = tmp.setNum( <a class="code" href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">maximum</a>() - <a class="code" href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">singleStep</a>() ).length();</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;    <span class="keywordflow">if</span> ( w1 &gt; w )</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;        w = w1;</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160; </div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;    tmp.fill( <span class="charliteral">&#39;9&#39;</span>, w );</div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160; </div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;    w = <a class="code" href="class_qwt_painter.html#af66a967fc49ff6deae32c3fd3826045b">QwtPainter::horizontalAdvance</a>( m_data-&gt;valueEdit-&gt;fontMetrics(), tmp ) + 2;</div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160; </div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;    <span class="keywordflow">if</span> ( m_data-&gt;valueEdit-&gt;hasFrame() )</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;        w += 2 * style()-&gt;pixelMetric( QStyle::PM_DefaultFrameWidth );</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160; </div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;    <span class="comment">// Now we replace default sizeHint contribution of m_data-&gt;valueEdit by</span></div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;    <span class="comment">// what we really need.</span></div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160; </div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;    w += QWidget::sizeHint().width() - m_data-&gt;valueEdit-&gt;sizeHint().width();</div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160; </div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;    <span class="keyword">const</span> <span class="keywordtype">int</span> h = qMin( QWidget::sizeHint().height(),</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;        m_data-&gt;valueEdit-&gt;minimumSizeHint().height() );</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160; </div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;    <span class="keywordflow">return</span> QSize( w, h );</div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;}</div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160; </div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;<span class="preprocessor">#if QWT_MOC_INCLUDE</span></div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;<span class="preprocessor">#include &quot;moc_qwt_counter.cpp&quot;</span></div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclass_qwt_arrow_button_html"><div class="ttname"><a href="class_qwt_arrow_button.html">QwtArrowButton</a></div><div class="ttdoc">Arrow Button.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__arrow__button_8h_source.html#l00023">qwt_arrow_button.h:24</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a027cfd91946ca9a19a1d606411e0f374"><div class="ttname"><a href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374">QwtCounter::Button</a></div><div class="ttdeci">Button</div><div class="ttdoc">Button index.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8h_source.html#l00067">qwt_counter.h:68</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179"><div class="ttname"><a href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a1b29fe43c7d59986eb5854ddaf6f7179">QwtCounter::Button1</a></div><div class="ttdeci">@ Button1</div><div class="ttdoc">Button intended for minor steps.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8h_source.html#l00070">qwt_counter.h:70</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74"><div class="ttname"><a href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a30b64d40b31283807f1a4f3d57af0e74">QwtCounter::Button3</a></div><div class="ttdeci">@ Button3</div><div class="ttdoc">Button intended for large steps.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8h_source.html#l00076">qwt_counter.h:76</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d"><div class="ttname"><a href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374a6015e556fcb8c4d45126dee5435b478d">QwtCounter::Button2</a></div><div class="ttdeci">@ Button2</div><div class="ttdoc">Button intended for medium steps.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8h_source.html#l00073">qwt_counter.h:73</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f"><div class="ttname"><a href="class_qwt_counter.html#a027cfd91946ca9a19a1d606411e0f374aca8e93a2d129f7cc91f54f5f4da20c5f">QwtCounter::ButtonCnt</a></div><div class="ttdeci">@ ButtonCnt</div><div class="ttdoc">Number of buttons.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8h_source.html#l00080">qwt_counter.h:79</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a0d764a96706593d8c8b51338e92abfcc"><div class="ttname"><a href="class_qwt_counter.html#a0d764a96706593d8c8b51338e92abfcc">QwtCounter::setStepButton2</a></div><div class="ttdeci">void setStepButton2(int nSteps)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00444">qwt_counter.cpp:444</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a13dcb52e2b6a6ad9ab42f99cc51e677c"><div class="ttname"><a href="class_qwt_counter.html#a13dcb52e2b6a6ad9ab42f99cc51e677c">QwtCounter::minimum</a></div><div class="ttdeci">double minimum() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00286">qwt_counter.cpp:286</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a1881fcb0f81052bd7787523246d19515"><div class="ttname"><a href="class_qwt_counter.html#a1881fcb0f81052bd7787523246d19515">QwtCounter::value</a></div><div class="ttdeci">double value() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00225">qwt_counter.cpp:225</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a259de8df2b8928139d1fc4738694eac8"><div class="ttname"><a href="class_qwt_counter.html#a259de8df2b8928139d1fc4738694eac8">QwtCounter::stepButton3</a></div><div class="ttdeci">int stepButton3() const</div><div class="ttdoc">returns the number of increment steps for button 3</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00465">qwt_counter.cpp:465</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a429a2e986aa46c1231643df5d4c78970"><div class="ttname"><a href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">QwtCounter::setValue</a></div><div class="ttdeci">void setValue(double)</div><div class="ttdoc">Set a new value without adjusting to the step raster.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00202">qwt_counter.cpp:202</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a4f5847dca54ada119623908730568f4d"><div class="ttname"><a href="class_qwt_counter.html#a4f5847dca54ada119623908730568f4d">QwtCounter::setMinimum</a></div><div class="ttdeci">void setMinimum(double)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00277">qwt_counter.cpp:277</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a55908902767443a3079b6635da98ddb5"><div class="ttname"><a href="class_qwt_counter.html#a55908902767443a3079b6635da98ddb5">QwtCounter::sizeHint</a></div><div class="ttdeci">virtual QSize sizeHint() const override</div><div class="ttdoc">A size hint.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00759">qwt_counter.cpp:759</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a59c836008c9c9e2c9c3048cbd5c80778"><div class="ttname"><a href="class_qwt_counter.html#a59c836008c9c9e2c9c3048cbd5c80778">QwtCounter::isReadOnly</a></div><div class="ttdeci">bool isReadOnly() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00186">qwt_counter.cpp:186</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a5cb416959b578a1615e000bc8c40e359"><div class="ttname"><a href="class_qwt_counter.html#a5cb416959b578a1615e000bc8c40e359">QwtCounter::wrapping</a></div><div class="ttdeci">bool wrapping() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00351">qwt_counter.cpp:351</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a613e5d3f2111f7263cf540156d9413e9"><div class="ttname"><a href="class_qwt_counter.html#a613e5d3f2111f7263cf540156d9413e9">QwtCounter::isValid</a></div><div class="ttdeci">bool isValid() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00166">qwt_counter.cpp:166</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a6469133eb210b470023a3dcc735aec4d"><div class="ttname"><a href="class_qwt_counter.html#a6469133eb210b470023a3dcc735aec4d">QwtCounter::~QwtCounter</a></div><div class="ttdeci">virtual ~QwtCounter()</div><div class="ttdoc">Destructor.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00127">qwt_counter.cpp:127</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a694ed7277e137e44bccc5918b4c15ecc"><div class="ttname"><a href="class_qwt_counter.html#a694ed7277e137e44bccc5918b4c15ecc">QwtCounter::buttonReleased</a></div><div class="ttdeci">void buttonReleased(double value)</div></div>
<div class="ttc" id="aclass_qwt_counter_html_a8b55539578de083793b8310cb8909294"><div class="ttname"><a href="class_qwt_counter.html#a8b55539578de083793b8310cb8909294">QwtCounter::setStepButton3</a></div><div class="ttdeci">void setStepButton3(int nSteps)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00459">qwt_counter.cpp:459</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a8cedf22e415018876353a17c8a8758b5"><div class="ttname"><a href="class_qwt_counter.html#a8cedf22e415018876353a17c8a8758b5">QwtCounter::maximum</a></div><div class="ttdeci">double maximum() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00306">qwt_counter.cpp:306</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a8dfcf202ef15050184788f24b069c4b7"><div class="ttname"><a href="class_qwt_counter.html#a8dfcf202ef15050184788f24b069c4b7">QwtCounter::singleStep</a></div><div class="ttdeci">double singleStep() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00328">qwt_counter.cpp:328</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a8fc7d115682f295dfcc64fa8312ccdeb"><div class="ttname"><a href="class_qwt_counter.html#a8fc7d115682f295dfcc64fa8312ccdeb">QwtCounter::setWrapping</a></div><div class="ttdeci">void setWrapping(bool)</div><div class="ttdoc">En/Disable wrapping.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00342">qwt_counter.cpp:342</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a900729c8f73830b549ea065e5c6dc4f9"><div class="ttname"><a href="class_qwt_counter.html#a900729c8f73830b549ea065e5c6dc4f9">QwtCounter::setNumButtons</a></div><div class="ttdeci">void setNumButtons(int)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00362">qwt_counter.cpp:362</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a91149ef07b94558456479357d6f98151"><div class="ttname"><a href="class_qwt_counter.html#a91149ef07b94558456479357d6f98151">QwtCounter::incSteps</a></div><div class="ttdeci">int incSteps(QwtCounter::Button) const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00416">qwt_counter.cpp:416</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_a968c0886f2ee4dd54430f4f7e622faad"><div class="ttname"><a href="class_qwt_counter.html#a968c0886f2ee4dd54430f4f7e622faad">QwtCounter::event</a></div><div class="ttdeci">virtual bool event(QEvent *) override</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00485">qwt_counter.cpp:485</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_aa06625ab417f82fdc82790e3376af708"><div class="ttname"><a href="class_qwt_counter.html#aa06625ab417f82fdc82790e3376af708">QwtCounter::setValid</a></div><div class="ttdeci">void setValid(bool)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00142">qwt_counter.cpp:142</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_ab7aa5fbf0041f6e1d99c1ceafbc8bb10"><div class="ttname"><a href="class_qwt_counter.html#ab7aa5fbf0041f6e1d99c1ceafbc8bb10">QwtCounter::numButtons</a></div><div class="ttdeci">int numButtons() const</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00388">qwt_counter.cpp:388</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_abc926a33f67199790a2e759fed84bfe5"><div class="ttname"><a href="class_qwt_counter.html#abc926a33f67199790a2e759fed84bfe5">QwtCounter::keyPressEvent</a></div><div class="ttdeci">virtual void keyPressEvent(QKeyEvent *) override</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00524">qwt_counter.cpp:524</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_ac308bb656eaa001641bdef6524d40ce6"><div class="ttname"><a href="class_qwt_counter.html#ac308bb656eaa001641bdef6524d40ce6">QwtCounter::setIncSteps</a></div><div class="ttdeci">void setIncSteps(QwtCounter::Button, int numSteps)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00403">qwt_counter.cpp:403</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_acec167b50ae44afe5ff8e9233e77a939"><div class="ttname"><a href="class_qwt_counter.html#acec167b50ae44afe5ff8e9233e77a939">QwtCounter::stepButton2</a></div><div class="ttdeci">int stepButton2() const</div><div class="ttdoc">returns the number of increment steps for button 2</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00450">qwt_counter.cpp:450</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_ad34441cf06c68478b826e5b85fbb3ba7"><div class="ttname"><a href="class_qwt_counter.html#ad34441cf06c68478b826e5b85fbb3ba7">QwtCounter::setReadOnly</a></div><div class="ttdeci">void setReadOnly(bool)</div><div class="ttdoc">Allow/disallow the user to manually edit the value.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00177">qwt_counter.cpp:177</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_ad794d0d2589a38113933ae764e87ce22"><div class="ttname"><a href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">QwtCounter::setRange</a></div><div class="ttdeci">void setRange(double min, double max)</div><div class="ttdoc">Set the minimum and maximum values.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00241">qwt_counter.cpp:241</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_add02928c348417fbfadd7095d058f331"><div class="ttname"><a href="class_qwt_counter.html#add02928c348417fbfadd7095d058f331">QwtCounter::valueChanged</a></div><div class="ttdeci">void valueChanged(double value)</div></div>
<div class="ttc" id="aclass_qwt_counter_html_ae56a556a72955b6d10419f2c41779383"><div class="ttname"><a href="class_qwt_counter.html#ae56a556a72955b6d10419f2c41779383">QwtCounter::setStepButton1</a></div><div class="ttdeci">void setStepButton1(int nSteps)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00429">qwt_counter.cpp:429</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_aee94cdbaf1f3d22e110fd3535dbca34a"><div class="ttname"><a href="class_qwt_counter.html#aee94cdbaf1f3d22e110fd3535dbca34a">QwtCounter::QwtCounter</a></div><div class="ttdeci">QwtCounter(QWidget *parent=NULL)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00065">qwt_counter.cpp:65</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_aeeb79c9b83b2050baf9d7e6e47f1fa67"><div class="ttname"><a href="class_qwt_counter.html#aeeb79c9b83b2050baf9d7e6e47f1fa67">QwtCounter::setSingleStep</a></div><div class="ttdeci">void setSingleStep(double stepSize)</div><div class="ttdoc">Set the step size of the counter.</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00319">qwt_counter.cpp:319</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_af097141eaa83c32c7eb7d4234079f95a"><div class="ttname"><a href="class_qwt_counter.html#af097141eaa83c32c7eb7d4234079f95a">QwtCounter::setMaximum</a></div><div class="ttdeci">void setMaximum(double)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00297">qwt_counter.cpp:297</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_afe42754ad6e79fbbca1a69c23e7fc380"><div class="ttname"><a href="class_qwt_counter.html#afe42754ad6e79fbbca1a69c23e7fc380">QwtCounter::wheelEvent</a></div><div class="ttdeci">virtual void wheelEvent(QWheelEvent *) override</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00591">qwt_counter.cpp:591</a></div></div>
<div class="ttc" id="aclass_qwt_counter_html_affdd91a6698ff0c90e24e69ff410924f"><div class="ttname"><a href="class_qwt_counter.html#affdd91a6698ff0c90e24e69ff410924f">QwtCounter::stepButton1</a></div><div class="ttdeci">int stepButton1() const</div><div class="ttdoc">returns the number of increment steps for button 1</div><div class="ttdef"><b>Definition:</b> <a href="qwt__counter_8cpp_source.html#l00435">qwt_counter.cpp:435</a></div></div>
<div class="ttc" id="aclass_qwt_painter_html_af66a967fc49ff6deae32c3fd3826045b"><div class="ttname"><a href="class_qwt_painter.html#af66a967fc49ff6deae32c3fd3826045b">QwtPainter::horizontalAdvance</a></div><div class="ttdeci">static int horizontalAdvance(const QFontMetrics &amp;, const QString &amp;)</div><div class="ttdef"><b>Definition:</b> <a href="qwt__painter_8cpp_source.html#l01379">qwt_painter.cpp:1379</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>qwt_counter.cpp</b></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
